/*
 * FileName : test.cpp
 */

//#include <mysql/mysql.h>
#include <iostream>
#include "happyballot.h"
#include <string.h>

using namespace std;

int function( string * point ) {
	point[0] = "dfdsdfdsf";
}

int main(int argc, char * argv[]) {
	/*string host("localhost");
	string user("zpw");
	string pwd("zpw123456");
	string dbName("test");

	unsigned int port = 3309;

	int status;
	
	MYSQL * mysql;
	mysql = mysql_init(0);
	MYSQL_RES * restult;
	if(!mysql_real_connect(mysql, host.c_str(), user.c_str(), pwd.c_str(),
						   dbName.c_str(), port, NULL, CLIENT_FOUND_ROWS)) {
		cout << "connect failure!" << endl;
		return 0;
	} else {
		cout << "connect success!" << endl;
	}
	
	status = mysql_real_query ( mysql, "select * from totalMessages", 28 );
	
	cout << status << " status " << endl;	

	mysql_close(mysql);



	cout << "test" << endl;
*/

string comment = "<<j2kjlkj> < jkjo >";
string comment2 = comment;
for ( int i = 0; i < comment.length(); i ++ ) {
	if ( comment[i] == '<' ) {
		comment.replace( i, 1, "&lt;" );
		i += 3;
	}
	else if ( comment[i] == '>' ) {
		comment.replace( i, 1, "&gt;" );
		i += 3;
	}


}
cout << comment2 << endl;
cout << comment << endl;
}
